<?php

define('ITEM_TYPE','pages');

class Controller extends PXFController 
{
	public function __construct()
	{
		parent::__construct(); 
	}

	public function index()
	{
		$this->view();
	}

	public function view()
	{
		$item = PXFRequest::reqGetOrDefault('item',PXFConfig::DEFAULT_PAGE); 

		$params = array();
		$params['condition'] = new PXFCondition('visibility',PXFConfig::VISIBILITY_PUBLIC);
		$params['condition']->add(PXFCondition::opAND('resource_id',$item));

		$mod_items = PXFModel::getModel('item');
		$item = $mod_items->findBy($params,true);

		PXFRequest::notNullOr404($item);

		PXFConfig::$site['page_title'] = $item->title;
		$this->tpl->assign('site',PXFConfig::$site);
		$this->tpl->assign('item',$item);
		$this->tpl->display('home.index.tpl');
	}
}

?>

